package com.ds.home.proxy;

//import com.ds.context.JDSActionContext;

import com.alibaba.fastjson.annotation.JSONField;
import com.ds.home.EIScene;
import com.ds.home.engine.AppEngine;
import com.ds.iot.HomeException;
import com.ds.iot.Scene;
import com.ds.iot.ZNode;




public class SceneProxy implements Scene{
	@JSONField(serialize=false)
	
	private EIScene dbScene;
	private String systemCode;


	public SceneProxy(EIScene dbScene,String systemCode){
		this.dbScene=dbScene;
		this.systemCode=systemCode;

	}

	

	public Integer getIntvalue() {
		
		return dbScene.getIntvalue();
	}

	public String getName() {
		
		return dbScene.getName();
	}

	public String getObjvalue() {
		
		return dbScene.getObjvalue();
	}

	public String getSceneid() {
	
		return dbScene.getSceneid();
	}

	public String getSensorid() {
		return dbScene.getSensorid();
	}

	public Integer getStatus() {

		return dbScene.getStatus();
	}
	@JSONField(serialize=false)
	
	public ZNode getZnode()  {
		ZNode znode=null;
		try {
			znode=  AppEngine.getEngine(systemCode).getZNodeById(this.getSensorid());
		} catch (HomeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return znode;
	}

	public void setIntvalue(Integer intvalue) {
		dbScene.setIntvalue(intvalue);
	}

	public void setName(String name) {
		dbScene.setName(name);
	}

	public void setObjvalue(String objvalue) {
		dbScene.setObjvalue(objvalue);
	}

	public void setSensorid(String sensorid) {
		dbScene.setSensorid(sensorid);
	}

	public void setStatus(Integer status) {
		dbScene.setStatus(status);
	}

	public void setSceneid(String sensorid) {
		dbScene.setSensorid(sensorid)	;	
	}

}
